package com.miyu.client1;

import com.blinkfox.fenix.EnableFenix;
import com.miyu.client1.utils.baseDao.MiyuJpaRepositoryFactory;
import com.miyu.client1.utils.baseDao.MiyuRepositoryFactoryBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.IOException;


//@EnableFenix //启动第三方jpa 管理处理 两种方式 1 启动类 2，dao调用时
@EnableJpaRepositories(repositoryFactoryBeanClass = MiyuRepositoryFactoryBean.class)
@SpringBootApplication
@EnableEurekaClient
@Component
@EnableTransactionManagement

public class Client1Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Client1Application.class);
    }

    public static void main(String[] args) {


        SpringApplication.run(Client1Application.class, args);

        try {
            Runtime.getRuntime().exec("cmd /c start http://127.0.0.1:" + "18762"+"/book/index");
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
